<template>
  <div class="container">
    <!-- {{ monthData }} -->
    <error-tip :errorCode="errorCode" v-if="errorCode"></error-tip>
    <div v-else>
      <card-list :monthData='monthData'></card-list>
    </div>
  </div>
</template>

<script>
import  getData from '@/services/index'
import { getNowDate } from '@/libs/utils'
import { computed, onMounted } from 'vue'
import { useStore } from 'vuex'
import CardList from '@/components/MonthPage/List'
export default {
  setup() {
    const store = useStore()
    onMounted(() => {
      let field = store.state.field;
      getData(store, field, getNowDate(field))
    })

    return {
      monthData: computed(() => store.state.monthData),
      errorCode: computed(() => store.state.errorCode)
    }
  },
  components: {
    CardList,
  }
}
</script>

<style lang="less" scoped>

</style>